<script setup>
import { ref, onMounted } from 'vue'
import { myListAPI } from '@/api/login'

const itemList = ref([
  { label: '场地地点', key: '-' },
  { label: '预约时间', key: 'createTime' },
  { label: '申请人', key: 'reqUserName' },
  { label: '手机号', key: 'reqUserPhone' },
  { label: '申请时间', key: 'createTime' },
  { label: '审批编号', key: '-' },
])

const listData = ref([])
const getList = async () => {
  const res = await myListAPI()
  listData.value = res.data
}

onMounted(() => {
  getList()
})
</script>

<template>
  <view class="my-application">
    <detail-card
      v-for="(item, index) in listData"
      :key="index"
      :title="item.reqName"
      :status="item.status"
      :obj="item"
      :itemList="itemList"
    ></detail-card>
    <no-data v-if="listData.length == 0" />
  </view>
</template>

<style lang="scss" scoped>
.my-application {
  min-height: 100vh;
  background: #f5f5f5;
  padding: 40rpx 24rpx;
}
</style>
